package org.brisling.ethic.service;

import org.brisling.base.domain.RetDomain;
import org.brisling.common.ConstSysParam;
import org.brisling.ethic.domain.EvaluateSubDomain;
import org.brisling.ethic.repository.EthicEvaluateSubRepo;
import org.brisling.ethic.service.base.BaseEthicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;


@RestController
@RequestMapping("/ethicEvaluateSub")
/**
 * 用戶后台服務service
 * @Author : jackson wang
 * @Date   : 2015年6月8日 下午4:18:01
 * @version: 1.0
 */
public class EthicEvaluateSubService extends BaseEthicService<EvaluateSubDomain>{
	
			
	@SuppressWarnings("unused")
	@Autowired
	private EthicEvaluateSubRepo baseRepo;	
	
//	@Autowired
//	private ShiroSecurityService shiroSecurityService;
//	@Autowired
//	private QueryEthicEvaluateService qryEthicEvaluateService;
	
	public EthicEvaluateSubService(){
		this.moduleName = ConstSysParam.MODULE_ETHIC_EVALUATE_SUB;
		this.clazz = EvaluateSubDomain.class;
	}
	
	/**
	 * 获取业务主页面 
	 * @return
	 */
	@RequestMapping("/mainPage.action")
	public ModelAndView getMainPage(){
		return new ModelAndView("/ethic/ethic_evaluate/main");
	}
	
	/**
	 * 获取业务编辑页面
	 * @return
	 */
	@RequestMapping("/editPage.action")
	public ModelAndView getEditPage(){
		return new ModelAndView("/ethic/ethic_evaluate/editDlg");
	}
	
	
	/**
	 * 删除记录,单条或批量删除记录,id不为空，执行单条删除，id为空且ids不为空，执行批量删除
	 * @param id	待删除的单条记录id
	 * @param ids	待删除的多条记录id，以','分隔
	 * @return
	 */
	@RequestMapping("/del.action")
	public RetDomain delRow(@RequestParam(value="id",required=false) Long id,@RequestParam(value="ids",required=false) String ids){
				
		return super.delRows(id, ids);		 
	}
	
	/**
	 * 删除记录,单条或批量删除记录,id不为空，执行单条删除，id为空且ids不为空，执行批量删除
	 * @param id	待删除的单条记录id
	 * @param ids	待删除的多条记录id，以','分隔
	 * @return
	 */
	@RequestMapping("/flowDel.action")
	public RetDomain delFlowRow(@RequestParam(value="id",required=false) Long id,@RequestParam(value="ids",required=false) String ids){
		
			return delRow(id,ids);
		
	}
	
	
	/**
	 * 保存日常考评记录
	 * @param id
	 */
	@RequestMapping("/save.action")
	public EvaluateSubDomain save(@RequestBody String body){
		EvaluateSubDomain role = bodyToObj(body, EvaluateSubDomain.class);		
		
		return super.saveNoBizno(role);
	
	}
	
	
	
	
}
